package com.kingschan.jeasytag.tag.tree;

import java.io.IOException;
import javax.servlet.jsp.JspException;
import com.kingschan.jeasytag.core.annotations.tag.*;
import com.kingschan.jeasytag.core.parse.TagParseFactory;
import com.kingschan.jeasytag.tag.RootTag;

/**
 * tree tag
 * @author kingschan
 *2013-3-15
 */
@TagMetaData(tag="ul",CssClass="easyui-tree"	
)
public class TreeTag extends RootTag {
	private static final long serialVersionUID = 1L;
	//Properties
	@StringField
	private String url;
	@StringField
	private String method;
	@BooleanField
	private String animate;
	@BooleanField
	private String checkbox;
	@BooleanField
	private String cascadeCheck;
	@BooleanField
	private String onlyLeafCheck;
	@BooleanField
	private String lines;
	@BooleanField
	private String dnd;
	@JsonArrayField
	private String data;
	@EventField(args = { "param","success","error"})
	private String loader;
	@EventField(args = { "data","parent"})
	private String loadFilter;
	
	
	//Events
	@EventField(args = { "node" })
	private String onClick;
	@EventField(args = { "node" })
	private String onDblClick;
	@EventField(args = { "node","param" })
	private String onBeforeLoad;
	@EventField(args = { "node","data" })
	private String onLoadSuccess;
	@EventField(args = { "arguments" })
	private String onLoadError;
	@EventField(args = { "node" })
	private String onBeforeExpand;
	@EventField(args = { "node" })
	private String onExpand;
	@EventField(args = { "node" })
	private String onBeforeCollapse;
	@EventField(args = { "node" })
	private String onCollapse;
	@EventField(args = { "node","checked" })
	private String onBeforeCheck;
	@EventField(args = { "node","checked" })
	private String onCheck;
	@EventField(args = { "node" })
	private String onBeforeSelect;
	@EventField(args = { "node" })
	private String onSelect;
	@EventField(args = { "e","node" })
	private String onContextMenu;
	@EventField(args = { "target","source","point" })
	private String onDrop;
	@EventField(args = { "node" })
	private String onBeforeEdit;
	@EventField(args = { "node" })
	private String onAfterEdit;
	@EventField(args = { "node" })
	private String onCancelEdit;
	
	
	
	@Override
	public int doStartTag() throws JspException {
		try {			
			
			this.pageContext.getOut().write(TagParseFactory.executeParse(this,pageContext));
		} catch (Exception e) {			
			e.printStackTrace();
		}		
		return super.doStartTag();
	}
	
	
	
	
	
	@Override
	public int doEndTag() throws JspException {
		try {
			this.pageContext.getOut().write("</ul>");
		} catch (IOException e) {		
			e.printStackTrace();
		}
		return super.doEndTag();
	}
	
	
	
	
	
	
	
	
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getMethod() {
		return method;
	}
	public void setMethod(String method) {
		this.method = method;
	}
	public String getAnimate() {
		return animate;
	}
	public void setAnimate(String animate) {
		this.animate = animate;
	}
	public String getCheckbox() {
		return checkbox;
	}
	public void setCheckbox(String checkbox) {
		this.checkbox = checkbox;
	}
	public String getCascadeCheck() {
		return cascadeCheck;
	}
	public void setCascadeCheck(String cascadeCheck) {
		this.cascadeCheck = cascadeCheck;
	}
	public String getOnlyLeafCheck() {
		return onlyLeafCheck;
	}
	public void setOnlyLeafCheck(String onlyLeafCheck) {
		this.onlyLeafCheck = onlyLeafCheck;
	}
	public String getLines() {
		return lines;
	}
	public void setLines(String lines) {
		this.lines = lines;
	}
	public String getDnd() {
		return dnd;
	}
	public void setDnd(String dnd) {
		this.dnd = dnd;
	}
	public String getData() {
		return data;
	}
	public void setData(String data) {
		this.data = data;
	}
	public String getLoader() {
		return loader;
	}
	public void setLoader(String loader) {
		this.loader = loader;
	}
	public String getLoadFilter() {
		return loadFilter;
	}
	public void setLoadFilter(String loadFilter) {
		this.loadFilter = loadFilter;
	}
	public String getOnClick() {
		return onClick;
	}
	public void setOnClick(String onClick) {
		this.onClick = onClick;
	}
	public String getOnDblClick() {
		return onDblClick;
	}
	public void setOnDblClick(String onDblClick) {
		this.onDblClick = onDblClick;
	}
	public String getOnBeforeLoad() {
		return onBeforeLoad;
	}
	public void setOnBeforeLoad(String onBeforeLoad) {
		this.onBeforeLoad = onBeforeLoad;
	}
	public String getOnLoadSuccess() {
		return onLoadSuccess;
	}
	public void setOnLoadSuccess(String onLoadSuccess) {
		this.onLoadSuccess = onLoadSuccess;
	}
	public String getOnLoadError() {
		return onLoadError;
	}
	public void setOnLoadError(String onLoadError) {
		this.onLoadError = onLoadError;
	}
	public String getOnBeforeExpand() {
		return onBeforeExpand;
	}
	public void setOnBeforeExpand(String onBeforeExpand) {
		this.onBeforeExpand = onBeforeExpand;
	}
	public String getOnExpand() {
		return onExpand;
	}
	public void setOnExpand(String onExpand) {
		this.onExpand = onExpand;
	}
	public String getOnBeforeCollapse() {
		return onBeforeCollapse;
	}
	public void setOnBeforeCollapse(String onBeforeCollapse) {
		this.onBeforeCollapse = onBeforeCollapse;
	}
	public String getOnCollapse() {
		return onCollapse;
	}
	public void setOnCollapse(String onCollapse) {
		this.onCollapse = onCollapse;
	}
	public String getOnBeforeCheck() {
		return onBeforeCheck;
	}
	public void setOnBeforeCheck(String onBeforeCheck) {
		this.onBeforeCheck = onBeforeCheck;
	}
	public String getOnCheck() {
		return onCheck;
	}
	public void setOnCheck(String onCheck) {
		this.onCheck = onCheck;
	}
	public String getOnBeforeSelect() {
		return onBeforeSelect;
	}
	public void setOnBeforeSelect(String onBeforeSelect) {
		this.onBeforeSelect = onBeforeSelect;
	}
	public String getOnSelect() {
		return onSelect;
	}
	public void setOnSelect(String onSelect) {
		this.onSelect = onSelect;
	}
	public String getOnContextMenu() {
		return onContextMenu;
	}
	public void setOnContextMenu(String onContextMenu) {
		this.onContextMenu = onContextMenu;
	}
	public String getOnDrop() {
		return onDrop;
	}
	public void setOnDrop(String onDrop) {
		this.onDrop = onDrop;
	}
	public String getOnBeforeEdit() {
		return onBeforeEdit;
	}
	public void setOnBeforeEdit(String onBeforeEdit) {
		this.onBeforeEdit = onBeforeEdit;
	}
	public String getOnAfterEdit() {
		return onAfterEdit;
	}
	public void setOnAfterEdit(String onAfterEdit) {
		this.onAfterEdit = onAfterEdit;
	}
	public String getOnCancelEdit() {
		return onCancelEdit;
	}
	public void setOnCancelEdit(String onCancelEdit) {
		this.onCancelEdit = onCancelEdit;
	}




	
	
	
	
	

}
